package InputOutputStreamDemo;

import java.io.*;

public class OutputWriterDemo {
    public static void main(String[] args) {
        String readFilePath = "C:"+ File.separator+"Users"+File.separator+"Administrator"+File.separator+"Desktop"
                +File.separator+"1"+File.separator+"test.txt";
        File file = new File(readFilePath);


        try {
            OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(file));
            String content = "字符输出流转字节输出流";
            out.write(content);
            out.close();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
